<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>RGBAdjust Avisynth Filter</title>
<link rel="stylesheet" type="text/css" href="../../avisynth.css">
</head>
<body>
<h2><a name="RGBAdjust"></a>RGBAdjust</h2>
<p><code>RGBAdjust </code>(<var>clip,
  float &quot;r&quot;,  float &quot;g&quot;,  float &quot;b&quot;,  float &quot;a&quot;,
  float &quot;rb&quot;, float &quot;gb&quot;, float &quot;bb&quot;, float &quot;ab&quot;,
  float &quot;rg&quot;, float &quot;gg&quot;, float &quot;bg&quot;, float &quot;ag&quot;,
  bool &quot;analyze&quot;, bool &quot;dither&quot;</var>)</p>
<p>This filter multiplies each color channel with the given value, adds the
given bias offset then adjusts the relevant gamma, clipping the result at 0 and
255. Note that <code>RGBAdjust</code>(1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1)
leaves the clip untouched.<br>
  <br>
  <var>r </var>(-255.0 - 255.0; default 1.0): This option determines how much
  red is to be scaled. For example, a scale of 3.0 multiplies the red channel
  of each pixel by 3. Green and blue work similar.<br>
  <var>a </var>(-255.0 - 255.0; default 1.0) specifies the scale of the alpha
  channel. The alpha channel represents the transparency information on a
  per-pixel basis. An alpha value of zero represents full transparency, and a
  value of 255 represents a fully opaque pixel.</p>
<p>In <em>v2.56</em> the bias offsets <var>rb</var>, <var>gb</var>, <var>bb</var>, <var>ab
</var>(default 0.0) add a value to the red, green, blue or alpha channels. For
example, <var>rb</var> = 16 will add 16 to the red pixel values and -32 will subtract 32 from all
red pixel values.</p>
<p>Also in <em>v2.56</em> the exponents <var>rg</var>, <var>gg</var>, <var>bg</var>,
<var>ag</var>(default 1.0) adjust the gamma of the red, green, blue or alpha
channels. For example, <var>rg</var> = 1.2 will brighten the red pixel values
and <var>gg</var> = 0.8 will darken the green pixel values.</p>
<p>In <em>v2.56</em> analyze (can be true or false) will print out color statistics on the screen.
There are maximum and minimum values for all channels. There is an average
and a standard deviation for all channels. There is a "loose minimum&quot; and "loose
maximum&quot;. The "loose" values are made to filter out very bright or very dark noise specs
creating an artificially low or high minimum / maximum (it just means that the amount
of red/green/blue of 255/256 of all pixels is above (under) the loose minimum (maximum)).</p>
<p><i><var>dither</var></i> = true/false (false by default): When set to true, <a href="http://avisynth.org/mediawiki/Ordered_dithering" title="Ordered dithering">ordered
dithering</a> is applied when doing the adjustment.</p>
<p>Keep in mind ALL the values are not scaled to accomodate changes to one (for
that you should use levels) so doing something like:</p>
<pre>RGBAdjust(2, 1, 1, 1)</pre>
<p>will get you a whole lot of clipped red. If you WANT a whole lot of clipped red,
there you go - but if you want MORE red without clipping you should do</p>
<pre>Levels(0, 1, 255, 0, 128).RGBAdjust(2, 1, 1, 1)</pre>
<p>This would scale all the levels (and average lum) by half, then double the red.
Or more compact</p>
<pre>RGBAdjust(1.0, 0.5, 0.5, 1.0)</pre>
<p>This leaves the red and halves the green and blue.</p>
<p>To invert the alpha channel</p>
<pre>RGBAdjust(a=-1.0, ab=255)</pre>
<p>Thus alpha pixels values become a=(255-a)</p>
<p><b>Changelog:</b></p>
<table border="1">
  <tbody>
    <tr>
      <td>v2.56</td>
      <td>Added offsets, gamma, analyze.</td>
    </tr>
    <tr>
      <td>v2.60</td>
      <td>Added dither.</td>
    </tr>
  </tbody>
</table>
<p><kbd>$Date: 2011/12/04 15:28:44 $</kbd></p>
<FORM>
<INPUT TYPE="Button" VALUE="Back"
onClick="history.go(-1)">
</form>
</body>
</html>
